package com.fishbone.cloud.auth.exception;

import com.fishbone.core.api.IResultCode;
import org.springframework.security.core.AuthenticationException;

/**
 * @ClassName FishBoneAuthException
 * @Author huyaxi
 * @DATE 2020/4/24 14:45
 */
public class FishBoneAuthException extends AuthenticationException {

    protected IResultCode resultCode;

    private FishBoneAuthException(String msg, Throwable t) {
        super(msg, t);
    }

    private FishBoneAuthException(String msg) {
        super(msg);
    }

    public FishBoneAuthException(IResultCode resultCode){
        this(resultCode.getMessage());
        this.resultCode = resultCode;
    }

    public FishBoneAuthException(IResultCode resultCode,Throwable t){
        this(resultCode.getMessage(),t);
        this.resultCode = resultCode;
    }

    public IResultCode getResultCode() {
        return resultCode;
    }
}
